function DownloadPDFController(calendarViewHeader, downloadPDFView, repository) {
    this._repository = repository;
    this._downloadPDFView = downloadPDFView;
    this._headerStatus = calendarViewHeader.getHeaderStatus();
}

DownloadPDFController.prototype = {
    register: function() {
        var me = this;
        this._downloadPDFView.onGetHeaderDateRange(function() {
            return me._headerStatus.getShowingDateRange();
        });
        this._downloadPDFView.onGetSerizlizedReport(function() {
            return me._generateSerilizedReport();
        });
        this._downloadPDFView.init();
    },

    _generateSerilizedReport: function() {
        var report = new Report(this._repository);
        var rangeType = this._downloadPDFView.getDownloadRangeType();
        var r = this._headerStatus.selectedYearMonth.dateRangeOfMonth();
        if (rangeType == 'editRange'){
            r = this._downloadPDFView.getReportRange();
        }
        return report.getReport(r);
    }
};
